package cz.muni.fi.pa165.sme.web.pages;

import cz.muni.fi.pa165.sme.web.system.SportManagerAuthenticatedSession;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.ResourceModel;

/** @author jirankova */
public class LogoutPage extends TemplatePage {
	public LogoutPage() {
		add(new Label("title", new ResourceModel("logout.title")));

		logout();

		add(new Label("byeLabel", new ResourceModel("logout.text")));
	}

	private void logout() {
		SportManagerAuthenticatedSession session = SportManagerAuthenticatedSession.get();

		if(session.isSignedIn()) {
			session.signOut();
		}
	}
}
